-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(spanner): support transaction tags in partition DML #3473
Conversation
40ffebd
to
62cb4da
Compare
...spanner/src/main/java/com/google/cloud/spanner/AbstractMultiplexedSessionDatabaseClient.java
Outdated
Show resolved
Hide resolved
@@ -197,6 +197,10 @@ public static ReadQueryUpdateTransactionOption tag(String name) { | |||
return new TagOption(name); | |||
} | |||
|
|||
public static ReadQueryUpdateTransactionOption transactionTag(String name) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel this would bring in confusion to customers, mainly because transaction tags are supported in read-write transactions by using Options.tag
. Customers might try using this Options.transactionTag for read-write and will not work.
https://cloud.google.com/spanner/docs/introspection/troubleshooting-with-tags#java_1
Should we rename this to be more specific to PDML or is this somehow restricted to be used only for pdml transaction?
@@ -194,22 +194,29 @@ ExecuteSqlRequest newTransactionRequestFrom(final Statement statement, final Opt | |||
if (options.hasTag()) { | |||
requestOptionsBuilder.setRequestTag(options.tag()); | |||
} | |||
if (options.hasTransactionTag()) { | |||
requestOptionsBuilder.setTransactionTag(options.transactionTag()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The official documentation states that transaction tags not supported for read-only transactions and are supported for read-write, but there’s no mention of partitioned DML transactions.
can you please verify if transaction tags are indeed supported for pdml txn?
Closing this because sending transactionTag in partitionDML is no-op |
Fixes: #3347
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> ☕️
If you write sample code, please follow the samples format.